﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DefinedSpeed.aspx.cs" Inherits="ReportTracking.DefinedSpeed1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div id="divspeed">
    <table id="tbspeed"></table>
    <div id="pagerspeed"></div>
    </div>
    
    </form>


    <script type="text/javascript">
        var fd = $('#sDay').datebox('getValue') + sTime;
        var td = $('#eDay').datebox('getValue') + eTime;
        
        function LoadDataSpeed() {
            $(function () {
                jQuery("#tbspeed").jqGrid({
                    url: 'Services/DefinedSpeed.ashx?q=1'+'&fd='+fd +'&td='+td,
                    datatype: "json",
                    colNames: ['Loại xe', 'Tên xe', 'Vận tốc tối đa'],
                    pgbuttons: false,
                    pgtext: false,
                    pginput: false,
                    colModel: [
   		        { name: 'LPT', index: 'LPT', editable: true },
                { name: 'TENPT', editable: true, index: 'TENPT' },
   		        { name: 'VANTOC', editable: true, index: 'VANTOC' }

   	    ],
                    //rowNum: 10,
                    //rowTotal: 50,
                    //rowList: [10, 20, 30],
                    //$('#editmodtbspeed').css('z-index', 99999);
                    //$('#delmodtbspeed').css('z-index', 99999);
                    gridComplete: function () {
                        ReportTracking.Core.Browser.setCookie('idLPT', "", 1);
                    },
                    onPaging: function () {

                    },
                    onSelectRow: function (id) {
                        var ret = jQuery("#tbspeed").jqGrid('getRowData', id);
                        ReportTracking.Core.Browser.setCookie('idLPT', ret.LPT, 1);
                    },
                    autowidth: true,
                    height: (300 - 125),
                    pager: '#pagerspeed',
                    rownumbers: true,
                    sortname: 'LX',
                    loadonce: true,
                    viewrecords: true,
                    sortorder: "desc",
                    editurl: 'Services/DefinedSpeed.ashx', // this is dummy existing url
                    caption: "Định nghĩa vận tốc cho từng phương tiện"
                });
                jQuery("#tbspeed").jqGrid('navGrid', '#pagerspeed',
                    {refresh:false, search:false},
                    {height:200,reloadAfterSubmit:false}, // edit options
                    {height:200,reloadAfterSubmit:false}, // add options
                    {reloadAfterSubmit: false } // del options
                
                );
                
                //jQuery("#tbspeed").jqGrid('inlineNav', "#pagerspeed");
                //edit: true, add: true, del: true, search: false
            });
            
        }
        setTimeout('LoadDataSpeed();', 500);
    
    </script>

</body>

</html>
